HSW.is

by @disfordave

🌏

[Dev] Fetch Timeout Problem on SidWiki and Node.js

18/11/2025, 16:27

Contents

Apparently, after a few changes, that query is quite complicated for Node.js to handle, and it kept throwing this kind of error.

TypeError: fetch failed
    at async d […]
    at async Module.O ([…]) {
  [cause]: AggregateError: 
      at ignore-listed frames {
    code: 'ETIMEDOUT'
  }
}

It’s not happening all the time, only occasional hiccups like a network error.

Anyway, for now, this Node.js config solves this issue.

NODE_OPTIONS='--network-family-autoselection-attempt-timeout=500'

Node.js default timeout was 250ms (from Node.js docs)

Of course, I don’t like this kind of trick that has to be configured manually, crossing the line of the sacred default values of the core component, but I will figure out what exactly caused a slow network issue that eventually led to a timeout, but for now, let’s stick with this.

Thank you @gregonarash for the waaaay better answer than ChatGPT and Claude! Human dev answers are still very much helpful and important in the era of so-called vibe coding.

Update (2025-11-18, 23:42 KST)

Somehow, It failed to fetch an error again, and I was panicking. However, it turned out to be a different error (500), which was a Cloudflare issue. Phew! 😮‍💨

Also, after the global Cloudflare outage, there was a very weird db fetching issue. I was like, “Is this yet another bug?” But no, it only happened on my website hosted on Railway with Cloudflare domain, not on my local dev environment. Purging caches and setting the custom caching rules from the Cloudflare domain setting was the solution. (More about the Cloudflare outage)

Update (2026-02-27, 00:48 KST)

After purging cache from Cloudflare, SidWiki now works without any timeout issues even without that manual configuration. Apparently, corrupted cache can cause some hiccups in the server. Currently I disabled caching altogether for now.